#define _CRT_SECURE_NO_WARNINGS 1
//自除数
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
bool Judge(int num)
{
    int tmp = num;
    while (tmp > 0)//tmp小于0说明该数的每一位数已经参与判断
    {
        int digit = tmp % 10;//求出num的每一位数，从最后一位开始
        if (digit == 0 || num % digit != 0)//该数有0或者不能被自己包含的数整除
        {
            return false;
        }
        tmp /= 10;
    }
    return true;
}

int* selfDividingNumbers(int left, int right, int* returnSize)
{
    int * ret = (int *)malloc(sizeof(int) * (right - left + 1));
    int i = 0;
    int j = 0;
    for (i = left; i <= right; i++)//生成从left到right的每一个数
    {

        if (Judge(i))
        {
            ret[j] = i;
            j++;
        }
    }
    *returnSize = j;
    return ret;
}
int main()
{
    int left = 0;
    int right = 0;
    scanf("%d %d", &left, &right);
    int numsSize = 0;
    int* reception = selfDividingNumbers(left, right, &numsSize);
    int i = 0;
    for (i = 0; i < numsSize; i++)
    {
        printf("%d ", reception[i]);
    }
    return 0;
}